<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
${aier_doctype}
<html <s:property value="aier_html_xmlns" escape="false"/>>
<head>
<meta http-equiv="Content-Type" content="${aier_content_type}" />
<meta name="keywords" content="${aier_keyworks}" />
<meta name="description" content="${aier_description}" />
<title>${aier_title}</title>
<link rel="stylesheet" href="${aier_css_url}${aier_jqui_css}ui.css" />
<link rel="Stylesheet" href="${aier_css_url}jq/jq.css" />
<link rel="stylesheet" href="${aier_css_url}jcrop/jquery.Jcrop.min.css" />
<link rel="stylesheet" href="${aier_css_url}jcrop/jquery.Jcrop.css" />
<link rel="stylesheet" href="${aier_css_url}social/module/jq-msg.css" />
<link rel="stylesheet" href="${aier_css_url}social/module/reset.css" />
<link rel="stylesheet"
	href="${aier_css_url}social/user/accountSettings/common.css" />
<link rel="stylesheet"
	href="${aier_css_url}social/user/accountSettings/pi.css" />

<script type="text/javascript" src="${aier_js_url}j.js"></script>
<script type="text/javascript" src="${aier_js_url}b.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/hh/ui.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/msg.js"></script>

<script type="text/javascript" src="${aier_js_url}complexify/jquery.placeholder.min.js"></script>
<script type="text/javascript" src="${aier_js_url}complexify/jquery.complexify.js"></script>
<script type="text/javascript" src="${aier_js_url}97/WdatePicker.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/cn.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/jq.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/block.js"></script>
</head>
<!-- 修改密码 -->
<body>
	<!-- 顶栏 -->
	<s:action name="userhomecomm_homeHead" namespace="/user"
		executeResult="true"></s:action>

	<!-- 正文 -->
	<div id="hfContent" class="ar-content">
		<div class="content-main">
			<div class="main-content wrap-bg clearfix">
				<!-- 左侧栏 -->
				<s:action name="useraccountsettings_aSettingsLeft" namespace="/user"
					executeResult="true"></s:action>
				<!-- 右侧内容 -->
				<div class="ae-right">
					<div class="right-main">
						<div class="right-main-top">
							<div class="binfo-title">
								<h3>修改密码</h3>
							</div>
							<div class="right-line"></div>
						</div>
						<div class="right-main-c">
							<div class="info-tab01" style="padding: 70px;">
								<table>
									<tr>
										<th class="gray6">当前密码：</th>
										<td><input type="password" class="PY-input" name="pwd"
											id="pwd" maxlength="50">
										</td>
									</tr>
									<tr>
										<th class="gray6">新密码：</th>
										<td><input type="password" class="PY-input"
											name="newpwd1" id="newpwd1" maxlength="50"></td>
									</tr>
									<tr>
										<th class="gray6"></th>
										<td>
											<div class="clearfix">
												<div class="ae-mmqd">密码强度</div>
												<div id="progressbar">
													<div id="progress"></div>
												</div>
											</div></td>
									</tr>
									<tr>
										<th class="gray6">确认密码：</th>
										<td><input type="password" class="PY-input"
											name="newpwd2" id="newpwd2" maxlength="50"></td>
									</tr>
									<tr>
										<th class="gray6"></th>
										<td>
											<div class="mib-btn" onclick="uppwd();"></div>
										</td>
									</tr>
								</table>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- footer copyright -->
		<s:action name="userhomecomm_homeFooter" namespace="/user"
			executeResult="true"></s:action>
		<!-- /footer copyright -->
	</div>
</body>
<script type="text/javascript">
	// 修改密码
	function uppwd() {
		var pwd = $("#pwd").val().trim();
		var newpwd1 = $("#newpwd1").val().trim();
		var newpwd2 = $("#newpwd2").val().trim();
		if(newpwd1==""){
			$().message("请输入新密码");
			return
		}
		if(newpwd1!=newpwd2){
			$().message("2次输入的新密码不一样");
			return
		}		
		
		var fun = function(data) {
			if(1==data.s){
				$().message("修改密码成功!");
			}else{
				$().message("修改失败!"+data.error_info);
			}
		};
		exeAjax(ajaxUrl("${aier_url}${aier_urijs}useraccountsettings_updateNewPwd${aier_suffix}"), fun, 
		{"pwd":$("#pwd").val(),
		 "newpwd":$("#newpwd1").val()});
	}

	
	//密码强度
	$(function () {
        $("#newpwd1").complexify({}, function (valid, complexity) {
            if (!valid) {
                $('#progress').css({'width':complexity + '%'}).removeClass('progressbarValid').addClass('progressbarInvalid');
            } else {
                $('#progress').css({'width':complexity + '%'}).removeClass('progressbarInvalid').addClass('progressbarValid');
            }
            $('#complexity').html(Math.round(complexity) + '%');
        });
    });
	
</script>
</html>